Fixes #289

Add exception handling for pools.