Bug fixes to installation script