fix merge error in sparse mode and add equals/hashCode methods