Added working directory argument to check and generate commands (fixes #...

...98)