Fix issue 107 and factor TLD_ADDR logic