diff --git a/httprl.module b/httprl.module
index aad0be2..c4d2714 100644
--- a/httprl.module
+++ b/httprl.module
@@ -591,9 +591,8 @@ function httprl_handle_data(&$options) {
   // or PUT request. Some non-standard servers get confused by Content-Length in
   // at least HEAD/GET requests, and Squid always requires Content-Length in
   // POST/PUT requests.
-  $content_length = httprl_strlen($options['data']);
-  if ($content_length > 0 || $options['method'] == 'POST' || $options['method'] == 'PUT') {
-    $options['headers']['Content-Length'] = $content_length;
+  if (strlen($options['data']) > 0 || $options['method'] == 'POST' || $options['method'] == 'PUT') {
+    $options['headers']['Content-Length'] = httprl_strlen($options['data']);
   }
 }
 
@@ -1312,7 +1311,7 @@ function httprl_send_request($results = NULL) {
 
         // Read socket.
         $chunk = fread($r, $responses[$id]->chunk_size);
-        if (httprl_strlen($chunk) > 0) {
+        if (strlen($chunk) > 0) {
           $rw_done = TRUE;
           if (!isset($responses[$id]->time_to_first_byte)) {
             // Calculate Time to First Byte.
@@ -1372,7 +1371,7 @@ function httprl_send_request($results = NULL) {
 
         // Get stream data.
         $info = stream_get_meta_data($r);
-        $alive = !$info['eof'] && !feof($r) && !$info['timed_out'] && httprl_strlen($chunk);
+        $alive = !$info['eof'] && !feof($r) && !$info['timed_out'] && strlen($chunk);
         if (!$alive) {
           if ($responses[$id]->status == 'Connecting.') {
             $responses[$id]->error = $t('Connection refused by destination. TCP.');
@@ -2402,7 +2401,7 @@ function httprl_lock_release($name) {
 function httprl_print_empty(&$data, $level = 0) {
   $level++;
   if ($level < 10 ) {
-    if (is_object($data)) {
+    if (is_object($data) && !method_exists($data, '__set')) {
       foreach ($data as $key => $values) {
         $data->{$key} = httprl_print_empty($values, $level);
       }
