fix GenericWriter (see previous commit on GenericReader for explanations)