Fixed some to dos, argument checking socket timeout checking etc