Better handling of ajax errors.