The length scalar function removed trailing spaces from the original data before calculating the length (the length is expected to not count trailing spaces). The logic has been changed so that the original data is not affected by the length function.