Bugfix for allocating grid meshes.