Fix/cdodge/bad links can cause exception on rewrite