Fix a cast warning when compiling with MSVC

Would previously give a [C4800](http://msdn.microsoft.com/en-us/library/b6801kcy.aspx) warning.