Additional tweak to ensure that things mostly work when passing in a dictionary instead of a file.