Fixing issue with entity::clone() method