Greatly simplify isFunctionN, fix typo