@andrerom:
The problem is that if `$result` is an object, doing `isset( $result['responseHeaders'] )` will cause a fatal error.
This fix does not intend to deal in any way with the responseHeaders array, just the $result variable