Some C string handling fixes.