Fixes

This PR solves:

https://github.com/KanoComputing/peldins/issues/1206
https://github.com/KanoComputing/peldins/issues/1225
self.mode_index is only initialised if we trigger on_mode_changed first.