Moved dependency wrappers into tasks...

... to solve issue with "Write after end" errors (attempting to reuse the pipes after they have already been used and closed).