fix dirs ending in slash