Fixed some typecasting warnings.