in reply to Logical AND

I suspect that the variables are not really what you think they are. Try using print statements in the code to be completely sure what they are.