fixes to Perl scripts