Add the type attribute to a failed node, fix #92

This fixes the issue reported in #92 by adding the `type` attribute to the `<failed>` node.

fix #92