Fixed hostgroup handling. Fixed a recursion bug.