Count name bytes instead of length, add test