Fixing a grid generator bug