Fixed mismatch between exception types that caused an issue with the CLI.