Fixing api.getElements calls that refrence 'window' or 'self'