Bugfix handling toplevel elements