add: utility function gname2gid has been added.
fix: incorrect typecast has been fixed.