Avoid query error with odd parameter combination

Change-Id: I1fc4495d665ff2c1e0cbf274ee2081a06c4e603b