Fix for 64-bit (thanks to Tim T)