Fixed bug with parallelisation if s.outputs already existed. Added test.