diff --git a/configure.in b/configure.in
index 3555e453ef3992384b63b92f79503784f5ba2812..2155676caac185b0226171fb862f5bb07000f554 100644
--- a/configure.in
+++ b/configure.in
@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
 AC_CANONICAL_SYSTEM
 # The Docs Makefile.am parses this line!
 # remember to also change ndb version below and update version.c in ndb
-AM_INIT_AUTOMAKE(mysql, 5.1.14-beta)
+AM_INIT_AUTOMAKE(mysql, 5.1.15-beta)
 AM_CONFIG_HEADER(config.h)
 
 PROTOCOL_VERSION=10
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 73755cd2df9d0bb192ad38f97ee7d5debbb11897..bf410b6bd676865f69962027b95e71ad3e17dbd7 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -792,6 +792,9 @@ sub command_line_setup () {
     {
       # Only platforms that have native symlinks can use the vardir trick
       $opt_mem= $opt_vardir;
+      # Delete the default directory in case it exists since we're going to create
+      # a new one later anyway, and the mkpath below throws a fatal error otherwise
+      eval { rmtree($default_vardir, 1, 1); };
       mtr_report("Using 4.1 vardir trick");
     }
 
diff --git a/storage/ndb/src/common/util/File.cpp b/storage/ndb/src/common/util/File.cpp
index d893260f5649384bbeed23df786fdb76696c43a2..55a3cb705342618875f8d2069b8db7594aa7e4e5 100644
--- a/storage/ndb/src/common/util/File.cpp
+++ b/storage/ndb/src/common/util/File.cpp
@@ -51,7 +51,7 @@ File_class::size(FILE* f)
   MY_STAT s;
 
   // Note that my_fstat behaves *differently* than my_stat. ARGGGHH!
-  if(my_fstat(::fileno(f), &s, MYF(0)))
+  if (my_fstat(fileno(f), &s, MYF(0)))
     return 0;
 
   return s.st_size;