<fix> horizontal moves were skipped due to unset p->idx; <fix> general combo and perm, and cleanups;