Fixed jQuery AJAX race condition bug in autodiscover_fields.