Fix undefined bug for words with multiple paths