Multiple event queues support and some bugfixing.