Fix Some crashes

There are some crashes in setting strings.

This fixes that.