Fixes in grid generation for pedantic special cases when one or both