Fix test code not working in secondary worlds