Added tests for getDocuments()
Fixed construction with 'null' documents