Fix mk_tuple_type and improve get_unsat_core