Fix bug with getwd