Fix for adaptive boosting not terminating