small fixes for debug mode