Fixed a warning about cast.