Cleanup.  Addded write tests.