Fixed debug message contents.
Added support for stream and string templates to be copied.