This was only accounting for a single element in the first group. Now it handles arbitrary elements. Only the last element being capitalized matters. This fixes one issue in #3107
This was only accounting for a single element in the first group. Now it handles arbitrary elements. Only the last element being capitalized matters. This fixes one issue in #3107