       after @collection[table]
     else
       @db.collection table, (error, collection) =>
-        console.log 'Error with fetching collection: ' + error if error
+        console.log "Error with fetching collection: #{error}" if error
 
         @collection[table] = collection
         after collection


    @

  Long: (number) -> new mongodb.Long number
  ObjectID: (hex) -> ensureObjectId hex
  Timestamp: () -> new mongodb.Timestamp()
  DBRef: (collection, id) -> new mongodb.DBRef collection, id
  Binary: (buffer) -> new mongodb.Binary buffer
  Symbol: (string) -> new mongodb.Symbol string
  Double: (number) -> new mongodb.Double number

  _normalizeArguments: (params, options, after) ->
    if isFunction params
      after   = params
      params  = null
      options = {}

    if isFunction options
      after   = options
      options = {}

    after   = (->) if not after
    options = {}   if not options

    [params, options, after]

module.exports = EasyMongo
    @getInstance table, (collection) =>
      collection.count params, (error, results) =>
        if error
          console.log "Error with fetching counts: #{error}"
          return after false

        after parseInt results, 10
