Fix a crash and some edict warning spam.