Fixed locking and improved worker pool