Fixed on demand category once for functions with parameters

Refs #1764