Support flat grouping, fixes #15