Improve base64 decoding