added some tests to check ref count