fixed possible causes of stackoverflow errors
reworking save logic of the editor (see ECLIPSE-1042)