Better test suite. Fixing host lookup algorithm