Fix bug in sanitize_sql_hash_for_conditions