Fixed typecasting