fix for arrays with an object in their 'GLOBALS' key - for example Smarty