Converting more of the SMT code to ATS2