Fix port script so that it can be run again after a failure. Broke in v1.21.0.