Fixed base64 encoding bug