Fixed aggregate_by bug for single values coordinates.

Follows on from #1203.