Small optimisation to the stack collection.