Fixes to make JSON and base64 handling work properly.