Note that the test cases are really awkward so this is unlikely to actually happen normally, but implementation is much easier if it doesn't have to worry about these cases. [SVN r86704]