Fixed a few errors in grdmwrite