fix some bugs in debugmanager