Fix casting warnings.