SQLite has this crappy type system where you can put a string into a boolean or integer column, which of course will break once you try to read it as bool.. Also, add an index by IMSI to the SUBSCRIBER table.