Fix some of the db filters -building invalid hsql queries