TCP/IP additions and some small changes to the code