app: fix wrong test

This is actually incomplete, I'm sending another commit that improves
this test :-)
app: improve error messages during app creation

Somehow related to #296 (motivated by, at least).
app: improve error message for duplicate apps
app: fix assertion