Fixed the serious problems with edit mode