Minor fixes for writing/tests.