Further improves and fixes string handling