Fix obvious logic error