Fix some warnings, and fix hostgroups/servicegroups fetching