Read dirs from file; various refinements