Revert "Actually use mid and not id"

This reverts commit f44ea926a942c4c7ae536ca47ec5ec86c20a0b62.
Use index and mid where appropriate