Fix some directories handling