       else
         Promise.all cats.map (cat) =>
           @_resolveReference(@client.categories, 'categories', cat, "externalId=\"#{cat.id}\"")
-        .then (result) -> resolve(result.filter (c) => c)
+        .then (result) -> resolve(result.filter (c) -> c)
 
   _resolveReference: (service, refKey, ref, predicate) ->
     new Promise (resolve) =>

          id: taxCatId
          typeId: 'tax-category'
      if prodCatsIds
        product.categories = _.map prodCatsIds, (catId) =>
          id: catId
          typeId: 'category'
      Promise.resolve product

      @_resolveProductCategories(product.categories)
      @_resolveReference(@client.taxCategories, 'taxCategory', product.taxCategory, "name=\"#{product.taxCategory?.id}\"")
    ]
    .spread (prodTypeId, prodCatsIds, taxCatId) ->
      if prodTypeId
        product.productType =
          id: prodTypeId
