Fixes for VS2013 from Tim