Fix const-correctness in stream writers