Fixed problems when not all sub-directories are present.