Fixed potential bugs in MatchState.