Refactoring and section editing fixes