Fix bugs caused by rebase.