Fix refcount method and add tests for collect