change uint64_t to uint32_t for some unsigned long's