Fix a bug where invalid directory separators would get cached and used