Bug fix of _free_port and _get_stack_options for missing vars