fix some bugs. misc.