Fixing reference counting issues Dmytro and Rahul reported.

Using the normal reference counting seems to fix the exception Rahul encountered. Unclear why Volodymyr did something outside the normal path.