Bug fixes: offset collides with new database id, typos in table names, sql close connections, etc.