Fixed problem where the server didn't close the connection.
Fixed a problem where thread pool left in the background.