Fixed: Error in SQL query when using SQLite.