Fixed some holes in the logic enumerating last option and match.