fixed #508:
added test for grouping by base name