Fix parsing of some configuration files

Some configuration files attempt to access hostgroup information on objects that don't have them, such as contacts.  Check to see the hostgruop is valid before attempting to access any info.