Update scripts to test for directories