Added an assert in prediction funtion to check that the void class does not occur.