Some typecasting added.