Partial fix to #223

This fixes the string related bug in #223. There is still the cursor related bug and a draw box related bug.