Fixes to support 64bit systems.