Fix simulate where clause bug.