Improve stats

This change set fixes a potential bug in `String` and removes the need for a lock in `Stats`.