some fixes on sqlite3 database