Fix bug with ulong/uint/size_t mismatch.