Fix base64 encode/decode issue