Fix a bug in the grid component.