Fixed minor bug - wait for event queue condition IF the queue is empty, not WHILE...