Further script improvements