Workaround for MSVC std::function bug
Fix Clang compile and link errors