Fixed small bug in pruning condition