Fixes cli error handling