Due to an bug in gnuplot 4.6.0 to 4.6.3 accessing the number of parameters using $# does not work.

To be able to work also with this versions the $# == x was replaced with exists("$x-1") && !exists("$x").