Modifications to scripts with latest code update (a lot of search issues...

... fixed, OpenAM redirect loopback issue fixed removed code)