Correctly handle temp roots stack in callbacks.