Another bugfix for Query.parameterExists - This class needs to be refactored. It does too much.