Fixed issues #635 and #453 for VS 2012 and 2013.