Bug fix in the AddLayer undo command