fix a couple of 32-bit bugs