Work on removing duplicate scripts. Some other fixes.