fix some little bugs, #538