fixed event handling while match is inactive, added more tests