Conformance fixes
Some conformance requirements.
Marked WIP because the question of whether countOutput can be NULL is apparently not entirely resolved?
Remaining fix acts as if countOutput may legally be null, and prevents a crash in that case. Have moved the alternative resolution (can't have null countOutput) to a different branch.