correctly handle base64 and json, improve bin-file test