Fix nested AND expression bug