Fixed an error in the pattern grouping logic. Should now work with all patterns