tweaked base64 decoding