Fix move_before and move_after

Changes order are not saved.