Stop level processing once leave() is called

Fix #1909