Fixed error modifying history when adding a last empy point.
In JS dicts are passed by reference so we were modifying the original value. Undo it.