Fix equality operators when == is not overloaded for functions