MIAS: fix a few bugs in the getRequiredDirectories implementation