fix bug in script from upstream fork.