Fix a bug where directories are not normalized