Fixed issues #253 and #249 for VS 2013 and 2012.