Correctly handle nested feature queries