Some minor optimisations.