Fixed printToStream