Improved to compile with Visual Studio 2013

Made some minor changes so that this branch will compile using Visual
studio 2013 express.