Fixed potential crash when using current folder as output