Fix null pointer exception in Classify task