Improved the thread pool.
Fixed a pylint warning.