The user session runs with su rights and by default getpwuid returns root as user name. Also it is expected uid/gid = 0, but in fact uid/gid = 1 which is suitable for generic user but not for root.
Default uid/gid will be changed to 0, in case if alternate opinion will be absent.