Bugfixes in bootstrapping shell script