     unless searchterm
       msg.send 'Must provide a brewery name to ask about.'
       return
-
-    count = count_to_return
     untappd.searchBrewery (err, obj) ->
       return unless checkUntappdErrors err, obj, msg
-
-      for result in obj.response.brewery.items
-        if count < 0
-          continue
+      robot.logger.debug obj.response.beers
+      if obj.response.brewery.items.length == 0
+        return msg.send "No breweries matched '#{searchterm}'"
+      for result in obj.response.brewery.items[0...count_to_return]
         out_msg = result.brewery.brewery_name 
         if (result.brewery.location.brewery_city != "")
           out_msg += " ("+result.brewery.location.brewery_city + ", "+result.brewery.location.brewery_state+")"
         out_msg += " - " + result.brewery.beer_count + " beers (ID: #"+result.brewery.brewery_id+")"
 
         msg.send out_msg
-        count--
     , searchterm
 
   ##

    unless username
      msg.send 'Must provide a username to ask about.'
      return

    untappd.userFeed (err, obj) ->
      return unless checkUntappdErrors err, obj, msg
      if err
        msg.send "Could not retrieve recent checkins for #{username}."
        return

    msg.http(url)
      .get() (err, res, body) ->
        return unless checkHTTPErrors err, res, body, msg
        robot.logger.debug body
        result = JSON.parse(body)
        msg.send "1) Add #{result.response.user.user_name} as a friend - #{result.response.user.untappd_url}\n2) Type `#{robot.name} untappd approve`"

