Fix logic error in operations.