squash document validation bug, fixes #2