     data.last_message_sequence = @_lastMessageSequence
     # TODO: Some of these options will be deprecated in jQuery 1.8
     #       See: http://api.jquery.com/jQuery.ajax/#jqXHR
-    $.ajax @config.longPoll.url,
+    opts =
       crossDomain:  true
       data:         data
       timeout:      @_timeout
       success:      @_success
       error:        @_error
-      xhr:          hackAroundFirefoxXhrHeadersBug if $.browser is 'mozilla'
       complete:     @_xhrComplete
+    opts.xhr = hackAroundFirefoxXhrHeadersBug if $.browser.mozilla
+    $.ajax @config.longPoll.url, opts
 
   _xhrComplete: (jqXhr) =>
     console?.log "XHR complete", arguments
     # Get the last sequence from the server if specified.
+    console?.log "status #{jqXhr.status}"
     if jqXhr.status == 200
-      @_lastMessageSequence = jqXhr.getResponseHeader @messageSequenceHeader
-      console?.log "@_lastMessageSequence => #{@_lastMessageSequence}"
+      val = jqXhr.getResponseHeader @messageSequenceHeader
+      @_lastMessageSequence = val if val?
+      console?.log "Header #{@messageSequenceHeader} => #{val}"
       if @_lastMessageSequence == null
         console?.log 'ERROR: Unable to get last message sequnce from header'
 

    console?.log "_success", arguments
    @_open data
    return if @_stopRequestLoop
    if jqXhr.status == 204
      # If we get a 204 back, that means the server timed-out and sent back a 204 with a
      # X-Http-Next-Request header
      #
      # Why did we use a 204 and not a 408? Because FireFox is really stupid about 400 level error
      # codes and would claims its a 0 error code, which we use for something else. Firefox is IE
      # in this case
      @connect(@_okInterval)

# This code was shamelessly stolen from:
# https://github.com/jaubourg/ajaxHooks/blob/master/src/ajax/xdr.js
if $.browser.msie and parseInt($.browser.version, 10) in [8, 9]
  console?.log "Hacking AJAX CORS for Internet Explorer"
  jQuery.ajaxTransport (s) ->
    if s.crossDomain and s.async
      if s.timeout
