Fix some bugs

Fix some bugs