Corrections of some bugs