Fixed Notice warning on accessing deleted application.

Other misc changes