a fix some small bugs