fix broken underflow() and overflow() methods