Fix some bugs: