Can't get path.nodes[-1] in open path

I had a problem iterating all nodes (Segment type - NSArray object has not attribute 'type') and for me, it makes more sense that way. I‘ll fix it.