Fix crash condition with certain messages