Some fixes for `test_dir()`

:sweat_drops: