Some minor performance optimisations