Fix error in pattern matcher