fix test running
Fix indexOf on final element of strings (fix #133)