Remove duplicates from links list, also fix ya error with None object.