Some fixes for the new socket protocol