Minor changes to the raning algorithm.