Fix incorrect cast.