Fix stupid logic error