Add base64 decoding to fix problems with newlines etc