Fixed issues with threading and epoll.