Several improvements to the edit mode.