Fix output.write so that appropriate paramaters are given.