Events are emmited on agentLogic. Improved tests.