Migrated to Visual Studio 2013 and fixed a bug