Added some validation to the complex query runner.