Stupid mysql. Booleans should be cast by the database layer, perhaps the issue is there.