fix a few bugs

fix a few bugs