Fix bug where signatures were escaped twice in some cases