Doing more error handling in extension management; fixes #365.