Cleans up smallpool, adds locking