Limit number of allowed function decreases to 3.

This avoids entering oscillations in case of bad convergence behaviour.