fixed bugs

fixed some bugs.