Cleanup error handling
Indent output json
Correct test