Changed link generation for '#' characters.