fix C++11 narrowing conversion error