Attempts to fix some bugs with the demo and gpgrid code