Fix some bugs with trim string in ttl converter