Fix takeDir condition
Fix arg parsing