[#1839] added a cast to remove warnings on some compilers