install: Improve error handling