Sort out some possible cases where nil might be set to a dictionary