Dependency insertion fix (container agnostic)

This should be a bit better I think..
wait, why does it exclude the last element