Fixed event loop only processing one event at a time.
Merge pull request #2 from bmprovan/master

Touched up the event loop.