filter n_dir added, minor fixes