diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,15 @@
 ## Changelog
 
+### 1.0.3.1
+
+Released 2019-05-08.
+
+- Prevent filenames being treated as strings in debug messages.
+  Lua's `loadbuffer` takes a `source` description as an argument,
+  which is used for debug messages. The `loadfile` function now
+  adds a special prefix (`@`) to `source`, thus marking it as a
+  filename.
+
 ### 1.0.3
 
 Released 2019-05-04.
diff --git a/hslua.cabal b/hslua.cabal
--- a/hslua.cabal
+++ b/hslua.cabal
@@ -1,5 +1,5 @@
 name:                hslua
-version:             1.0.3
+version:             1.0.3.1
 synopsis:            Bindings to Lua, an embeddable scripting language
 description:         HsLua provides bindings, wrappers, types, and helper
                      functions to bridge Haskell and <https://www.lua.org/ Lua>.
diff --git a/src/Foreign/Lua/Core/Auxiliary.hsc b/src/Foreign/Lua/Core/Auxiliary.hsc
--- a/src/Foreign/Lua/Core/Auxiliary.hsc
+++ b/src/Foreign/Lua/Core/Auxiliary.hsc
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE OverloadedStrings #-}
 {-|
 Module      : Foreign.Lua.Core.Auxiliary
 Copyright   : © 2007–2012 Gracjan Polak,
@@ -35,6 +36,7 @@
 
 import Control.Exception (IOException, try)
 import Data.ByteString (ByteString)
+import Data.Monoid ((<>))
 import Foreign.C ( CChar, CInt (CInt), CSize (CSize), CString
                  , withCString, peekCString )
 import Foreign.Lua.Core.Constants (multret, registryindex)
@@ -182,7 +184,7 @@
 loadfile :: FilePath -- ^ filename
          -> Lua Status
 loadfile fp = Lua.liftIO contentOrError >>= \case
-  Right script -> loadbuffer script fp
+  Right script -> loadbuffer script ("@" <> fp)
   Left e -> do
     Lua.pushstring (Utf8.fromString (show e))
     return Lua.ErrFile
