Fix base64 encoding