That’s part 3 resolved.
Part 2 I have a fix for shelved, ready to be submitted soon.
Part 1 however, I haven’t been able to reproduce using that exact scenario. It’s possible that this was a bug that’s already been fixed. Does that exact scenario fail for you?