Fix base64 encoding with streams

Fixes [gh-207].
missing curly braces