Only refer to application after activity is created. Fixes #4