           (loop-with-index col [c line]
             (let [chr        (or (get c :fx-character) (get c :character))
                   chr        (if (and (= layer-id base-layer-id)
-                                      (= chr (char 0)))
+                                      (char? chr)
+                                      (= (char chr) (char 0)))
                                  \space
                                  chr)
                   highlight  (= @cursor-xy [col (- rows row 1)])

      [id texture-id])))
        
(defn png-bytes [path]
  (let [input-stream (FileInputStream. (str path))
        decoder (PNGDecoder. input-stream)
        width (.getWidth decoder)
        height (.getHeight decoder)
        bytebuf (ByteBuffer/allocateDirect (* width height 4))]
    (.decode decoder bytebuf (* width 4) PNGDecoder$Format/RGBA)
    (.flip bytebuf)
    (.close input-stream)
    bytebuf))

;; Extract native libs and setup system properties
(defn init-natives []

                             (.withProfileCore true))
        icon-array         (when icon-paths
                             (condp = (LWJGLUtil/getPlatform)

                               LWJGLUtil/PLATFORM_LINUX (into-array ByteBuffer [(png-bytes (get icon-paths 1))])
                               LWJGLUtil/PLATFORM_MACOSX  (into-array ByteBuffer [(png-bytes (get icon-paths 2))])
                               LWJGLUtil/PLATFORM_WINDOWS (into-array ByteBuffer [(png-bytes (get icon-paths 0))
                                                                                  (png-bytes (get icon-paths 1))])))
        latch              (java.util.concurrent.CountDownLatch. 1)]
     ;; init-natives must be called before the Display is created
     (init-natives)
