       wasReady.set false
 
   @_searchParametersHandle?.stop()
-  @_searchParametersHandle = Deps.autorun ->
+  @_searchParametersHandle = Deps.autorun =>
     # Every time filter or sort is changed, we reset counts
     # (We don't want to reset counts on currentLimit change)
     Session.get variables.filter

  @_searchParametersHandle = null
  @_subscriptionAutorunHandle?.stop()
  @_subscriptionAutorunHandle = null

Template.catalogFilter.documentsName = ->
  @documentClass.verboseNamePlural()

          Session.set variables.loading, false
    else
      Session.set variables.loading, false

  @_searchResultHandle?.stop()
  @_searchResultHandle = Deps.autorun =>
    fields = {}
    fields["count#{@data.documentClass.name}s"] = 1

    searchResultCursor = SearchResult.documents.find
      name: @data.subscription
      query: [Session.get(variables.filter), Session.get(variables.sort)]
    ,
      fields: fields

    # Store how many results there are
    searchResultCursor.observe
      added: (document) =>
        Session.set variables.count, document["count#{@data.documentClass.name}s"]
      changed: (newDocument, oldDocument) =>
        Session.set variables.count, newDocument["count#{@data.documentClass.name}s"]

Template.catalog.destroyed = ->
  @_resetSignalHandle?.stop()
