Serialization and VM fixes