fix and add test for ObjectPool