Fix restoring globals on another frame fails on Firefox