Better tests for the case without global event loop + fixes.