maxElements configuration was enforced across all objects in document
Merge pull request #1 from yanome/master

maxElements configuration was enforced across all objects in document (thanks yanome)