Fixes host order bug and improves logging.