CustomHelper: fix nested links code.

call to nestedLinks was referencing variables not defined.