Add indexes, sqlite compatibility and protect "