more setup script bug fixes