Fixed a cast warning