Corrections and extensions to the setup script