fix some small bugs