Updated to correctly remove nomonitoring environments from search query generated hostgroups.