Closes #656. Added 2 more asserts to ensure the count decrements correctly.