Fixed a bug for cloning a state .