Clean up bugs Perl 5.18 pointed out