Avoid double-encoding thread titles

Fixes #567, #718