Fix VS2013 warnings about integer conversions