fixes to support 64 bit compilation