change uint64_t to ulong, to make mac happy, this is final change