The names file could contain carriage return characters if it was made in Windows.
\n is the end of line code for Linux
\r\n is the end of line code for Windows
\n represents a newline character
\r represents a carriage return character
Code:
# $'\r' gives a carriage return character in bash
i=Zygmunt$'\r' # append a carriage return character
echo "${i}999"
999munt
# Using bash parameter expansion to remove the carriage return
echo "${i%$'\r'}999"
Zygmunt999