fixed bugs in test_hosts