Fix query generation for bool columns

Change-Id: I122dfcd1fc98212d3c111ffb10b2baaaf4121dc9