fixed a few bugs in the setup script