Fix some errors on compiling on VS2013, still not working though.