Assert on stream write.

And prevent re-initialization of defaults().
Complete tests for defaults module.