If it helps, the workaround for getting a working save after this was to temporarily disable the conditional block at line 59 in corpse.lua and load and re-save.
You're right, that block doesn't make much sense. The function is supposed to handle cases where either an entity or nil is passed on. If there was an entity, I wanted to make sure that it really is a character-corpse entity, which only works if the entity is valid. However, that breaks if the function is fed data of an already expired (invalid) corpse.
The other bug is a bit more complicated. There are properties that can't be nil, so they should be initialized with a sane default value. Working on it …