Fix setup tool for use with gnome

And fix 2 regressions introduced by the Python3 port.