Discovered a bug in the Self-Tracking Entity Generator Template yesterday while working with the modification suggested by Jeff Derstadt in the blog article http://blogs.msdn.com/b/adonet/archive/2011/02/09/self-tracking-entities-original-values-and-update-customization.aspx.
Now I have finally after a bit of debugging found the problem, which seems to be a bug in the template (And maybe in fact in the framework?).
The problem is that the SetValue function does a check against the clr type of the property if it is a Nullable type or not and if it isn't Nullable setting the original value won't happen. For some reason this check fails, even if my column is Nullable (which the EdmProperty.Nullable states) and the code fails to update my changes to the database.
If I try to change this code to check against EdmProperty.Nullable instead, the code fails with an exception in OriginalValueRecord.SetValue instead (which uses the same rules).