Fix override of link text.
Only override provided link text with the display title if the
provided link text is a case sensitive match for the target page name.
Previously, a case insensitive match would be overridden by the display
title. This reverts to the original behavior.
Also fix undefined variable.