Implement java.io.Serializable and fix bug in Histogram.merge