Fixup cast to array in getLinkListImpl().

Remove some dead code while at it.