Fix casting warning