Fix C++11 narrowing warnings