fix core when doing queries with &'s in them
Merge branch 'master' into testing