fixed cleanup when the source was in the archive root

and some other minor things