fixed missing last line and encoding issues that were breaking docx. fix range errors for changes and beginning & end of edition