Improved the setup script error handling