Updated string handling for code scan