increased hardcoded array sizes+fixedcrashes

I increased the hardcoded array sizes, which I'll fix soon, and fixed
some crashes in the string handling routines.