Fixed CWD bugs with CLI.