Some tiny optimisations in here.