Fix tracking of isDirty on edition, clear in sync which is called on succesful save
Clean up code, ensure correct positions on links