When using the beforeRemove callback with the foreach binding, the supplied index parameter is always 0. Bug seems to have been introduced with KO 3.5.0 Beta; it wasn't present in 3.4.2.
See here for reproduction: https://codepen.io/gxzzin/pen/KKNPKeO