fix some bugs when debuging in Linux