Fix for BOM encoding