bugfix: fixed static references to app in garbage collection routines