Fix serialize of Unit(error due to instance variables who weren't
serializable)