Added automatic creation of stop elements, closes #3