Update logic in findElem, getMod, setMod and byMod.