fixed the check; uncommented the user-substitution regression test
change K to KItem in samples
changed K to KItem in include
added the missing function attribute to substitution