Replace uses of "long" with uint32_t, and similar; fixes 64-bit bugs