Script cleanup - merge fixes