Fix compilation with DEBUG defined.

Output stream should not be const ref.