Replace all base64 decoding errors with BadData.

Perhaps Exception is not the best thing to catch.