Fix for https://github.com/nipy/nipype/issues/533

This is a fix for https://github.com/nipy/nipype/issues/533.

Please see that ticket, or write me with any questions.