Enable strict WHERE handling
Replace remaining manual parameter quoting with prepared statements