Make Statds writer works.

Next, fix tests.