Fix unit tests

It's fixe the test suite after two errors:
* invalid boolean tests
* an crash when we have no PRIMARY KEY