Check for correct stops ordering in functions (fixes #33)