Check order of top-level fields in result

And fixed a bug in `inlineProject`, with an integration test.