Just add
set datafile missing NaN
at the beginning of the script and forget about everything :)
Granted, you'll not get into the deepness of the mystery, but life moves on, time is money and much more :)