diff --git a/hyper.cabal b/hyper.cabal
--- a/hyper.cabal
+++ b/hyper.cabal
@@ -1,5 +1,5 @@
 Name:               hyper
-Version:            0.1.0.3
+Version:            0.2.1.0
 Synopsis:           Display class for the HyperHaskell graphical Haskell interpreter
 Description:
   This package is part of the /HyperHaskell/ project and provides
@@ -11,9 +11,9 @@
 License-file:       LICENSE
 Author:             Heinrich Apfelmus
 Maintainer:         Heinrich Apfelmus <apfelmus quantentunnel de>
-Copyright:          (c) Heinrich Apfelmus 2016-2018
+Copyright:          (c) Heinrich Apfelmus 2016-2020
 
-Cabal-version:      >= 1.8
+Cabal-version:      >= 1.10
 Build-type:         Simple
 
 Source-repository head
@@ -23,9 +23,10 @@
 
 Library
     hs-source-dirs:     src
-    build-depends:      base         >= 4.6   && < 4.13
+    build-depends:      base         >= 4.5   && < 4.15
                         , deepseq    >= 1.2   && < 1.5
                         , blaze-html >= 0.7   && < 0.10
                         , text       >= 0.11  && < 1.3
     exposed-modules:    Hyper
                         , Hyper.Internal
+    default-language:   Haskell2010
diff --git a/src/Hyper.hs b/src/Hyper.hs
--- a/src/Hyper.hs
+++ b/src/Hyper.hs
@@ -10,7 +10,7 @@
     Display(..),
     
     -- * Internal
-    displayIO,
+    displayIO, addFinalizerSession,
     ) where
 
 import Hyper.Internal
diff --git a/src/Hyper/Internal.hs b/src/Hyper/Internal.hs
--- a/src/Hyper/Internal.hs
+++ b/src/Hyper/Internal.hs
@@ -8,16 +8,19 @@
     -- * Documentation
     Graphic(..), string, html,
     Display(..),
-    displayIO,
+    finalizeSession, addFinalizerSession,
     ) where
 
 import           Control.DeepSeq
+import           Data.IORef
 import           Data.List            (isPrefixOf)
 import           Data.Typeable
+import           System.IO.Unsafe     (unsafePerformIO)
 
-import qualified Data.Text       as T
-import qualified Data.Text.Lazy  as TL
-import qualified Text.Blaze.Html as H
+import qualified Data.Text        as T
+import qualified Data.Text.Lazy   as TL
+import qualified Text.Blaze.Html  as H
+import qualified Text.Blaze.Html5 as H
 import qualified Text.Blaze.Html.Renderer.Text as H
 
 {-----------------------------------------------------------------------------
@@ -30,7 +33,7 @@
 
 -- | Render a 'String' as a 'Graphic'.
 string :: String -> Graphic
-string = Graphic . TL.toStrict . H.renderHtml . H.toHtml
+string = Graphic . TL.toStrict . H.renderHtml . H.div . H.toHtml
 
 -- | Render arbitrary HTML code as a 'Graphic'.
 -- 
@@ -46,8 +49,11 @@
 ------------------------------------------------------------------------------}
 -- | Class for displaying Haskell values.
 class Display a where
-    display :: a -> Graphic
+    display   :: a -> Graphic
+    displayIO :: a -> IO Graphic
 
+    displayIO = return . display
+
 instance Display ()           where display x = x `seq` fromShow x
 instance Display Graphic      where display = id
 instance Display Bool         where display = fromShow
@@ -58,6 +64,10 @@
 instance Display [Int]        where display = displayList
 instance Display [String]     where display = displayList
 
+instance Display a => Display (IO a) where
+    display   _ = string "<<IO action>>"
+    displayIO m = fmap display m
+
 fromShow :: Show a => a -> Graphic
 fromShow = string . show
 
@@ -65,13 +75,16 @@
 displayList = fromShow
 
 {-----------------------------------------------------------------------------
-    Internal Class for displaying either IO actions or values
+    Interpreter management
 ------------------------------------------------------------------------------}
-class DisplayIO a where
-    displayIO :: a -> IO Graphic
+refFinalizers :: IORef [IO ()]
+refFinalizers = unsafePerformIO $ newIORef []
 
-instance Display a => DisplayIO (IO a) where
-    displayIO = fmap display
-instance Display a => DisplayIO a where
-    displayIO = return . display
+addFinalizerSession :: IO () -> IO ()
+addFinalizerSession m = modifyIORef refFinalizers (m:)
+
+finalizeSession :: IO ()
+finalizeSession = do
+    sequence_ =<< readIORef refFinalizers
+    writeIORef refFinalizers []
 
