fix test failures under perl 5.18 and 5.20 (patch from Debian)