Fix some Perl deprecation warnings. Patches from xim.