BugFix VS2012 (2)

Replication of #2001

Fix #2049
Fix #1995