Fix compile warning about type cast.