Fix the build on linux, static_cast problem