Fixed small issues with the way sections are inserted.