SQLite compatibility fixes

Change-Id: I517dc3c7d63371d23a0b745e4079f4bc5925ae16