Remove extraneous if and while blocks.