Added better logging
Fixed socket addr handling