Fix for AccessViolation on Windows 8.1 x64

This is a fix for an error that was happening on Windows 8.1 x64.
I do not want to break any good behavior, but this fixed the problem.

Please review it. Thank you!