minor bugfix in cwd handling