Fix multi-threaded listening.