Fix a cast warning when compiling with MSVC

Would previously give a C4800 warning.
Merge pull request #722 from lioncash/casts

Fix a cast warning when compiling with MSVC