Fixed a bug when pid/gid is null