Verify correct refcount & no scalars are leaked

Fixes gh-1