Fixed warning

Fixed a compile warning about casting.