Script: Fix memory corruption caused by 6560518