Fix uid/gid check