Fix serialization issue in variableinstance