Fixed bug in grid tiles method. Added grid unit tests.