Fix operation when path contains spaces