Fixed a bug that let to a crash when using invalid characters in the path