Merge in next patch for --socket