Gotcha on the serialization bit.  Just move this line to L158 then.  There may be no harm in setting it in both cases, but I also can't think of a *good reason* for doing it, so therefore it shouldn't be.