Added backported support for SQLite3
Added check to not delete the main instance