Fixed a bug in the numdevices-variable