Fix directory problems