Added some extra checks to be more tolerant for configration faults