Fixes to allow for compilation under windows VS2010