Fix error on cloning classes