repaired GetDocuments for flag usage