Fixed wrong working directory handling on CLI (issue #433)