Replace invalid script paths with valid ones