Further fix to IP detection

On a computer with multiple network interface adapters listed when you type 'ipconfig', it was choosing the wrong address since it simply chose the first address. This adds some additional selection parameters recommended in this stackoverflow article to choose the active one.