Fixed bug in NDGrid clusterer

While playing around with the `NDGrid` clusterer, I found a bug that wasn't covered by the unit test set. This PR fixes the bug and adds a test for a 3-dimensional set of coordinates (where I stumbled on the issue initially).