A new, more robust implementation MatchSetting.