Detection of malfunctioning nozzles