Ensure locals have correct context for emission