Make install script more robust