Fix bugs to make ObjectPool and Battier pass their unit test.