Inside a Record an enum is stored as a single byte. Since all bytes are preinitialized to 0, all enum variables are set to the first (index 0) element of an enum list (Enum.values()) instead of null.
The methods TemplateBase.readEnumExpression(...) and TemplateBase.writeEnumExpression(...) should handle the difference.