Minor changes to printtree.
Changed some debug lines to use putdebuglog.