Fixing the order of transformations when insert and replace are at the same position.