Fix crash when not installed
Clean up error handling