Fix chg_dir indexing.