Correct a logic error in auto resizing code.