Make the install script a bit more robust