Fix reference counting for blocks.

Hopefully, there is no weird situation left where it fails...