Minor script improvements