Fix func/ptr cast warning; work around MSVC2012 lack of C++11.