Hide reference counting implementation details.
Explicitly state that the reference counter is 32 bits.
Add assertions on the reference counter value.