Fixed a bug with typecasting