Fix logic error.