Fix SQLite3 row ID issue