Changed uint64_t to uintmax_t to avoid compatibility problems across 32 and 64 bit machines.