Allow custom SQL queries
Fix broken where string handling