Fix bug in deleting tables for SQLite databases