Bugfixes to IP, MAC and port generation for tree script