Added more user-friendly and descriptive handling of invalid configuration files, and prevent NPEs in metrics when this happens.