Almost forgot to fix table.write_db().