Add leaf-mode, fix some other mode-issues