Fixed JSON error reporting.