fix incorrect handling of binary writers