Tests for writers class, misc bugfix