Custom rules and empty content

Sorry - this isn't a pull request but I wanted to include some code to illustrate the problem I'm having....

As you can see in 9de723377f230c3, something weird happens with custom rules in the case of empty content. The commit message has more details of the exact problem. In 42c55777ecdd I found that the problem seems to be somehow related to the `result.override` property but the change in that commit is not meant to be a fix as I'm sure it breaks other stuff!

Do you know what is going wrong here?