Gracefully handle documents with an arbitrary number of title elements.

Closes #2.