Fix borrowck errors and warnings in script.