Dbg fixes

fix two issues found by building and running the testsuite with python-dbg