Stronger name length check, simpler id truncation