Bugfix: Grid number in error messages.

The error message refers to `cgmsgrid`, which is not defined in this
context (or anywhere else in the project). I changed it to refer to `grid`
instead.