avoid recursion errors through set_subt; add tests