Fix base64 conventions and add logging