Fix general issues with unit tests (timeouts, events, etc.)