Eliminate some unnecessary if blocks.