More small Query improvements

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