Some minor cleanup in Query


 - https://issues.jboss.org/browse/ISPN-4627
 - https://issues.jboss.org/browse/ISPN-4628