Fixing some equality bugs. Unfinished. [ci skip]