I agree, there was some debug in there that just got removed just before I pushed.

Your suggestion will not always work as node.attributes['type'] doesn't always exist.

I'll change this awkward if statement. Thanks