Fix some NPEs related to type variable bounds
Fix NPE caused by MatchLocator clearing 'scope' backpointer for groovy matches too soon.