app: fix error message for invalid app names

Fix #447.