Fix the type order for the reverse match index
The match classes would allow different types for each end of the match, but there was a mistake where the different types were not correct in the reverse match index, that was not spotted until matching different types was needed