Experimenitng with socket options.
nicer debug output.
Merge branch 'test' into dev