Fixed a formatting problem and avoided cloning before veryfing it is needed