Coorect some bugs