Fixing SQL statements to work with Postgres boolean data types.