misc, fix bug relating to copying locals back to globals in events when exceptions occur