Fixing base64 decode issues