Implementation of clone.