Fixed some link-generating errors.

The generated links were wrong.