fix some sharestate bugs
Merge branch 'document_paging' into testing