Style improvements and debugging in the docx indexing code