Bugfix to non-recusive tree html: moved button code to the place it should be located