handle grouping of empty lists
header key has already been stripped from the line
fix wrong name: ordered -> sorted
fix incorrect function name
Merge pull request #13 from david-farrar/master

Fix previous patch