Explicit cast to make C++ compilers happy