Fix scripting pipeline bug

I was getting attribute errors executing a script on a pipeline.

These changes seem to fix the problem. Not thoroughly tested, but might be helpful for others.