Added underflow detection to if and while statements.