Fix to convert to base64 and back