Oh, thanks for finding that issue! Could you put a FIXME in the relevant location so when the issue is dealt with the spots in the code could also be found?

Also, I'm not sure that `W: StringWriter` is the right bound here. Could `W: Writer` also work? I'm not sure if the method name should change, though.