Fix some bugs cause last commit