     $results = $('#search-results')
     template = if @options.grid then 'search/grid' else 'search/list'
     $results[if append then 'append' else 'html'] arcs.tmpl(template, results)
-    if not @search.results.length
-      $results.html "<div id='no-results'>No Results</div>"+    if not @search.results.query.total > 0
+      $results.html "<div id='no-results'>No Results</div>"

    return unless @search.results.length > @search.options.n
    results = new arcs.collections.ResultSet @search.getLast()
    @_render results: results.toJSON(), true

  # Render the results.
  render: ->
    @_render results: @search.results.toJSON()
    data = @search.results.query
    data.page = @search.page
    data.query = encodeURIComponent @search.query
    $('#search-pagination').html arcs.tmpl('search/paginate', results: data)

    @$('.sort-btn .icon-ok').remove()
    @$(e.target).append @make 'i', class: 'icon-ok'
    @$('#sort-btn span#sort-by').html @options.sort
    console.log("SEARCHING")
    @search.run null,
      order: @options.sort
      direction: @options.sortDir
