Use subdirectory as cwd if specified

Fixes #1600