diff --git a/inline.theme.inc b/inline.theme.inc
index cff3f81..90478a4 100644
--- a/inline.theme.inc
+++ b/inline.theme.inc
@@ -11,9 +11,9 @@
 function theme_inline_as_link($variables) {
     $file = $variables['file'];
     // Prepare link text with title or filename.
-    $linktext = ($file->title ? $file->title : $file->filename);
+    $linktext = isset($file->title) ? $file->title : $file->filename;
 
-    return l($linktext, file_create_url($file->filepath), array('attributes' => array('title' => t('Download: @name (@size)', array('@name' => $file->filename, '@size' => format_size($file->filesize))))));
+    return l($linktext, file_create_url($file->uri), array('attributes' => array('title' => t('Download: @name (@size)', array('@name' => $file->filename, '@size' => format_size($file->filesize))))));
 }
 
 /**
@@ -37,7 +37,7 @@ function theme_inline_img($variables) {
             'class' => 'inline-image-link',
             'title' => t("View") . ': ' . $title,
         );
-        $html = l($image, $file->uri, array('attributes' => $attributes, 'html' => TRUE));
+        $html = l($image, file_create_url($file->uri), array('attributes' => $attributes, 'html' => TRUE));
     } else {
         $html = $image;
     }
