Fix some issues in VS2012