port minor fixes around type handling from c++11 branch