Fixed test cases. Still having problems with the writer.