Fix incorrect trimming.