Fixing pool cancellation and adding tests