Fix NameError due to not defined host, port vars