improve error checking in new GString routines