Fixed some behaviour of the edit mode