Added some tests and code refinement towards the intermediate-stops feature