Bug: cannot use substring if name is shorter than the limit