     resultsets: []
 
     canTypeBeSorted: (typeCode) ->
-        t = Type[typeCode]
-        if t
-            return t.compare?
-
-        return false
+        return Type[typeCode]?
 
     compare: (typeCode, left, right, asc) ->
-        type = Type[typeCode]
+        return Type[typeCode]?.compare(left, right) * if asc then 1 else -1 ? 0
 
-        if type.compare?
-            val = type.compare(left, right)
-
-            if !asc
-                val = val * -1
-
-            return val
-
-        return 0
-
-    sort: (resultset, columnIndex, asc, resultsView) ->
+    sort: (resultset, columnIndex, asc) ->
         if resultset.columns[columnIndex].ascending?
             resultset.columns[columnIndex].ascending = !resultset.columns[columnIndex].ascending
         else

        clear = toolbar.appendChild(document.createElement('div'))
        clear.classList.add('clear')

        i = 0
        for resultset in resultsets
            @element.appendChild(@createTable(resultset, i))
            i++

    destroy: ->
        @element.remove()

        # Header columns
        if x.columns?
            col_tr = table.appendChild(document.createElement('tr'))
            for c, i in x.columns
                col_tr.appendChild(@createTh(c.name, resultsetIndex, i))

        # Rows
        if x.rows?
            for r in x.rows
                row_tr = table.appendChild(document.createElement('tr'))
                for c, i in r
                    row_tr.appendChild(@createTd(c, x.columns[i].type_code))

        return container

