Various optimisations for optimiser.