Fix to error reporting on ajax.