Fixed wrong fetch of server address: use socket address
More sonar violation and generic warnings fixes