incorporated upstream fixes: std::function<void>, small fixes