Use int64_t rather than long to make sure they're long enough on 32 bit