Backport length xlat so length tests pass