Undefined index + Invalid argument when there's no private links