Fix a bug when handling top-level questions

Top-level questions resulted in duplicated flattened-question arrays. A large number of top-level questions would grow the flattened array exponentially.

/cc @hampelm