Fix port checking code preventing startup directly after a SG restart