increment loop counter, fix string functions, add new tests