Added partial support for serialization.