Make parseInvoke more robust when <invoke> tag isn't closed. Test that.