Fixed nasty bug that made that sometimes hrefs were replaced twice or
incorrectly.