Fixed CWD handling.