small fixes to debug mode