For loop optimisations.