@domcleal, committed with change.  I added ||= even though there shouldn't be a situation where there is params['host'] AND params['hostgroup'] so it shouldn't matter.