Fix position underflow bug.