Fix grid implementation