Make compatible with bleadperl (via Father Chrysostomous)