Made tests more sane by using wait_for_event