fix Document.fill_defaults method to be recursive; enhance tests