I was fighting with the undo feature and thought that it finally works perfectly, it turns out I was mistaken. I will have to investigate what could've happened there.