More modifications to grid generation