As usual while waiting for the next release - don't forget to check the nightly builds in the forum.
...I tested your patch and can confirm it handles both cases as expected.So I'm ok about committing your entire patch.