fix chaining confusion and crash caused by mixing empty std::function and/or boost::function objects