Subroutine state printing improved, API updated