Attribute could be null, so encoding/decoding failed. Bug fixed!