Sorting on cluster ID when writing clustered results Fixes #23