Query engine: fixed query compiler to handle multiple extensions of same form