More fiddling with directory handling.