Additional tests and fixes (SQLite3, PostgreSQL)