Spain and Portugal recover from worst-ever blackout, terror link under probe