Added support for serialization.