Fix JS error when computing tab wrapping.