Fixed comparison and equality for custom datatypes.