Fix issue with multiple event loops.