         ]
       ).count() / (sub.get "perPage")
       n or 1
+    
     "Set": (k, v, sub) ->
       check k, String
       check v, @settings[k][1]
       check sub, Match.Where (sub) ->
         sub.connection?.id?
-      return 0  if @valuesEqual(@get(k, sub.connection.id), v)
+      
+      return 0 if @valuesEqual(@get(k, sub.connection.id), v)
+      
       if !@availableSettings[k] or (_.isFunction(@availableSettings[k]) and !@availableSettings[k] v, sub)
         @error 4002, "Changing #{k} not allowed."
+      
       changes = 0
       if v?
         changes = @_set k, v, cid: sub.connection.id + @name

      if pp > 0
        @n.push pp
    @n
  queueNeighbors: (page) ->
    for p in @neighbors page
      @queue.push p  if !@received[p] and !@requested[p]
  paginationNavItem: (label, page, disabled, active = false) ->
    p: label
    n: page
    active: if active then "active" else ""
    disabled: if disabled then "disabled" else ""
  paginationNeighbors: ->
    page = @currentPage()
    total = @sess "totalPages"

        name = name + "2"
    @id = "pages_" + name
    @name = name
  
  #
  
  registerInstance: ->
    Pages::_ninstances++
    Pages::instances[@name] = @
  
  # Set the collection on which this instance operates. Creates a new one if a name is passed in.
  
  setCollection: (collection) ->
    if typeof collection is 'object'
      Pages::collections[collection._name] = collection
