Fixed multi class detection bug about freeing too early an object.
View Cleanining with Aina.