Perl: Fix exception logic in encoder
Perl: A few extra FREEZE/THAW tests