Fixed stack smashing issues when setting a variable to a string over the container length.