Apply changes from https://rt.cpan.org/Ticket/Display.html?id=56794#txn-1341476