Fix app_chanisavail if there are invalid arguments (bug #1130)