lots of fixes, including app nesting