Auto typecasting problem