Correct a logic error