fixed chaining confusion and crash due to empty std::function and/or empty boost::function objects