Fix a potentially endless loop when looking up bot hostnames.