Corrected casting warnings.