Allow and test 1's in `grid_shape`

This closes issue #258. And does some small refactoring.