Added serialisations due to Kryo changes.