Added cwd instance guessing