Fix over-aggressive typecasting.