Fixes for working with data stored in SQLite instead of CSV