Fix calculation of rootDir now that commands are executed directly (fixes #158)