Make sure app is properly defined.