Minor fixes in string handling