diff --git a/COMPILE-linux.txt b/COMPILE-linux.txt
index a6af2cd072..af2436e555 100644
--- a/COMPILE-linux.txt
+++ b/COMPILE-linux.txt
@@ -74,7 +74,7 @@ OpenAL:           http://openal.org/
   Linux source:   http://kcat.strangesoft.net/openal.html
 OIS:              http://sourceforge.net/projects/wgois/
 FFmpeg:           http://ffmpeg.mplayerhq.hu/download.html
-Bullet:           (fill in here)
+Bullet:           http://bulletphysics.com/
 
 Setting up Bullet
 -----------------
diff --git a/COMPILE-win32.txt b/COMPILE-win32.txt
index bd1da4b66b..2ea3346296 100644
--- a/COMPILE-win32.txt
+++ b/COMPILE-win32.txt
@@ -77,17 +77,41 @@ OGRE:     http://ogre3d.org
 OIS:      Comes with the Ogre SDK
 OpenAL:   http://openal.org/
 FFmpeg:   http://ffmpeg.mplayerhq.hu/
-Bullet:   (fill in here)
+Bullet:   http://bulletphysics.com/
 
 The biggest problem is the lack of a prebuilt SDKs for FFmpeg and
 Bullet. You must build these yourself.
 
-FFmpeg must build it under Mingw (not Cygwin!). I found the following
+FFmpeg:
+
+FFmpeg must be built under Mingw (not Cygwin!). I found the following
 link helpful (read the comments as well, not just the post itself):
 http://www.gooli.org/blog/building-ffmpeg-for-windows-with-msys-and-mingw/
 
-Bullet: (not written yet)
+After building, place the dll files in the openmw "root" (same place
+as build_openmw.bat) and the include files in includes/ffmpeg. Refer
+to build_openmw.bat for the exact names and locations of expected files.
 
+Bullet:
+
+Bullet must also be built with Mingw. I used the MSYS shell for this,
+and the following commands:
+
+cmake -G "MinGW Makefiles"
+make
+
+There might be errors building the demos, but as long as the library
+files are built, this is OK. Use the command "find -iname *.a" to
+locate the libraries. The files you need are libLibBulletDynamics.a,
+libLibBulletCollision.a and libLibLinearMath.a. Copy these to the
+"root" openmw directory and rename them to:
+libbulletdynamics.a
+libbulletcollision.a
+libbulletmath.a
+
+Move or copy the entire src/ folder to openmw/includes/ and rename it
+to bullet/. Only the .h files are needed, you can delete everything
+else if you want.
 
 
 Building
diff --git a/build_openmw.bat b/build_openmw.bat
index 0169abeca9..8c4f8f2d82 100755
--- a/build_openmw.bat
+++ b/build_openmw.bat
@@ -5,6 +5,7 @@ rem See COMPILE-win32.txt for instructions.
 echo Compiling C++ files
 g++ -c sound\cpp_avcodec.cpp -I.\includes\ffmpeg\
 g++ -c ogre\cpp_ogre.cpp -I.\includes\ogre\
+g++ -c bullet\cpp_bullet.cpp -I.\includes\bullet\
 
 echo Compiling main program (openmw.exe)
-gdc -Wall -g openmw.d bsa\*.d core\*.d esm\*.d input\*.d nif\*.d ogre\*.d scene\*.d sound\*.d util\*.d cpp_ogre.o cpp_avcodec.o monster\util\*.d avcodec-51.dll avformat-52.dll avdevice-52.dll avutil-49.dll openal32.dll ogremain_d.dll OIS_d.dll -lstdc++ -o openmw.exe
+gdc -Wall -g openmw.d bsa\*.d core\*.d esm\*.d input\*.d nif\*.d ogre\*.d scene\*.d sound\*.d util\*.d bullet\*.d cpp_ogre.o cpp_avcodec.o cpp_bullet.o libbulletdynamics.a libbulletcollision.a libbulletmath.a monster\util\*.d avcodec-51.dll avformat-52.dll avdevice-52.dll avutil-49.dll openal32.dll ogremain_d.dll OIS_d.dll -lstdc++ -o openmw.exe
diff --git a/build_openmw.sh b/build_openmw.sh
deleted file mode 100755
index ac7d643697..0000000000
--- a/build_openmw.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-# See COMPILE-linux.txt for instructions
-
-make || exit 1
-
-gdc -Wall -g -fversion=Posix -o openmw openmw.d core/*.d ogre/*.d nif/*.d util/*.d bsa/*.d monster/util/*.d input/*.d sound/*.d scene/*.d esm/*.d cpp_ogre.o cpp_avcodec.o -lopenal -lm -lOgreMain -lOIS -lavcodec -lavformat -lstdc++
-
-gdc -Wall -g -fversion=Posix -o esmtool esmtool.d core/*.d ogre/*.d nif/*.d util/*.d bsa/*.d monster/util/*.d input/*.d sound/*.d scene/*.d esm/*.d cpp_ogre.o cpp_avcodec.o -lopenal -lm -lOgreMain -lOIS -lavcodec -lavformat -lstdc++
diff --git a/input/events.d b/input/events.d
index 19d1ac088b..ded0f6a7cd 100644
--- a/input/events.d
+++ b/input/events.d
@@ -239,7 +239,7 @@ extern(C) void d_handleKey(KC keycode, dchar text = 0)
 const float sndRefresh = 0.17;
 
 // Refresh rate for music fadeing, seconds.
-const float musRefresh = 0.2;
+const float musRefresh = 0.05;
 
 float sndCumTime = 0;
 float musCumTime = 0;
diff --git a/nif/data.d b/nif/data.d
index 2701591e25..208eab227e 100644
--- a/nif/data.d
+++ b/nif/data.d
@@ -153,7 +153,7 @@ class ShapeData : Record
           if(uvs > 0b111111)
             {
               nifFile.warn("UV count contains (unknown) flags");
-              uvs = uvs & 0b111111;
+              uvs = cast(short)(uvs & 0b111111);
             }
 
 	  uvlist = nifFile.getArraySize!(float)(uvs*verts*2);
diff --git a/nif/niffile.d b/nif/niffile.d
index e05f4e766f..79f44c1dda 100644
--- a/nif/niffile.d
+++ b/nif/niffile.d
@@ -302,16 +302,13 @@ struct NIFFile
     }
 
   // Set the size of the provided array to 'count', and fill it.
-  template getArraySize(T)
+  T[] getArraySize(T)(int count)
     {
-      T[] getArraySize(int count)
-	{
-	  T[] arr;
-	  fitArray(count, T.sizeof);
-	  arr = cast(T[])nifRegion.allocate(count * T.sizeof);
-	  getArrayLen!(T)(arr);
-	  return arr;
-	}
+      T[] arr;
+      fitArray(count, T.sizeof);
+      arr = cast(T[])nifRegion.allocate(count * T.sizeof);
+      getArrayLen!(T)(arr);
+      return arr;
     }
 
   // Get an array of Ts preceded by an array length of type Index