Added replacing link hrefs, bugfix