fixes for queries after OPT support