Fixed issue where function as argument might be used by reference instead of being invoked.