Write out errors and output independently to see which one is crashing.