Fixed NPE when y optional grouping is not defined correctly