(1) Make clipboard ordered, (2) fix bug when serializing the lattice