typecasting bug