Fix for 64-bit segfault

Fix for 64-bit segfault