Typecasting fix