Minor logic error