Better clone.

Clone as it was would not work correctly when we already had some types declared. This fixes it by special-casing types.