Fix cd() generator behavior