Bugfix: infinite loop due to wrong tab level