Added app id assertion. Fixed tests.