Rename AutoGrid to LineGrid, fix MemoryArray bugs