Fix getLinks code