More small Query improvements


 - https://issues.jboss.org/browse/ISPN-2782
 - https://issues.jboss.org/browse/ISPN-3583

# Please note:
- ISPN-2782 is urgent and should be included in the CR1
- ISPN-3583 Should be applied only if we agree on the mailing list