[fix] Set the correct index
[test] Added failing test for order preservation