Fix serialisation of keys when removing rows