Fix escaping with mixed binary/unicode arguments.

I am honestly not sure if this is the "correct" way to fix this. I'm open for suggestions!