fixed getMaxPosition() when no documents
Merge pull request #2 from vetalt/master

fixed getMaxPosition() when no documents