Fixes base64 encoding issues