Fix c++11 narrowing in clang and permissive in gcc