Fix bug in export.
Test exported types in depth.

May be too strict, but the protocol is still evolving (so we'll see).
Fix comment.