Fixing bug where the python code mutates the outputWriters instead of making a copy