More script improvements