Fixed bug in clone() method