setup.sh: fix some bugs