Fix concat str truncation

Fixes #217.

I also took the opportunity to add two small optimizations, which add up to make `Variable.concat` about 35% faster.