fix bad stack computations in subst compiler