Fixed bugs

fixed some bugs