Fix bas memory usage in grid walk