WORK IN PROGRESS: Fix indices

This is mainly to address https://github.com/geoadmin/mf-geoadmin3/issues/984

Please don't merge yet. I'm not done yet.