Fix underflow bug.