fix C++11 type conversion error