Fix tests failing on recent perls