Fix some operation bugs.