Issue #6 - Fixing bugs in event queue priority logic and creating unit test.