added more robust protection against invalid items in the configuration file