Fixed getMatches() foreach loop usage