Fixed some problems with the script for bug #7377.