Bug fixes for show_notes_tree

Signed-off-by: Niko Rosvall <niko@ideabyte.net>