Assorted bugfixes to DTSC and Socket libraries.