Some fixes to SimpleLogixExpression and Queries