Fix regression in end socket