Several minor performance fixes

Simplify String construction and other minor performances fixes.