Add some tests and fix folder logic for dx run --clone