fix for 64 bit bugs