Fix the behaviour of :history for ticks surrounding top level functions