Fixed directory handling.