Fixes a bug with the output writer.