Added pool finalization. Fixed exceptions catch.