Made pruning of zeros and empty lists configurable.