Fixed a bug in algorithm for determining neighbour cells.
Merge pull request #106 from TomFischer/BugFixGrid

Fixed a bug in algorithm for determining neighbour cells.