Fixed on demand getting set for functions, when category on demand not set

Closes #1384