Fix cast warning