More script work and some other fixes