Fix perl bugs.