Fix uid/gid checks.