At the stage when you remove non-system users, instead of "998" in the command, use "1000" - that will leave the original installation user defined. Then edit /etc/password (still under chroot)...