Fix tiny bug.
Slightly more efficient event loop.