fixes to GMat