Fix some conflicting loans
Update index impls.
Workaround conflicting loans when using util::swap.
Unused imports.