Fixes the right bugs and keeps intent of test.
Adds more reference count checks.

1 file changed