Add tests for writes