Fix error in model that occurs when one mode has zero occurrences.