Fixed aggregate_by bug for single values coordinates.

Closes #1183.