Check for directories before cloning

This way everything can run in series.