Added error handling, refactored pool manager and its tests for Itests and units.