Adding equals implementations if structural equality is not used.