Fixed typecasting to Boolean